package com.ny.zuoye2567.dao.service;

import
        com.ny.zuoye2567.dao.dao.ManagerDao;
import com.ny.zuoye2567.dao.dao.ManagerDaoImpl;
import com.ny.zuoye2567.dao.shiti.Manager;

import java.sql.SQLException;
import java.util.List;

public class ManagerServiceImpl implements ManagerService{
    private ManagerDao managerDao = new ManagerDaoImpl();

    @Override
    public Manager login(String name, String password) throws Exception {
        return managerDao.login(name, password);
    }

    @Override
    public List<Manager> findAllManager() throws SQLException, ClassNotFoundException {
        return managerDao.findAllManager();
    }

    @Override
    public int insertManager(Manager manager) throws SQLException, ClassNotFoundException {
        return  managerDao.insertManager(manager);
    }

    @Override
    public int updateManager(Manager manager) throws SQLException, ClassNotFoundException {
        return managerDao.updateManager(manager);
    }

    @Override
    public int deleteManager(String name) throws SQLException, ClassNotFoundException {
        return managerDao.deleteManager(name);
    }
}
